<?php if (!defined('BASEPATH')) exit('No direct script access allowed');

class DataProcessor{
	var $parent_model;
	var $ci;
	
	function DataProcessor( &$p ){
		if( !is_array($p) || !isset($p['parent_model'])){
			trigger_error('DataProcessor::DataProcessor - you must provide a parent model', E_USER_ERROR);
			return null;
		}else{
			$this->parent_model = $p['parent_model'];
			$this->renewInstance();
		}
	}
	
	function renewInstance(){
		$this->ci = &get_instance();
	}
	
	function _parseOptionString($string){
		$temp = null;
		$options = array();
		$temp = explode(';', $string);
		if( ($l=count($temp)) ){
			for($i=0;$i<$l;$i++){
				$key_val = explode('=>', $temp[$i]);
				if(count($key_val)==2){
					$options[$key_val[0]] = $key_val[1];
				}
			}
		}
		return $options;
	}
}

?>